<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ page import="com.erp.hibernate.beans.Employee"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link href="main.css" rel="stylesheet" type="text/css"/>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
	<script>
        function check(){
           if (confirm("您确定添加采购订单吗？")){
              if (document.getElementById("goodsid").value==""){
                  alert("物品编号不能为空！");
                  return false;
              }
              if (document.getElementById("goodsname").value==""){
                  alert("物品名称不能为空！");
                  return false;
              }
              if (document.getElementById("provider").value==""){
                  alert("供应商不能为空！");
                  return false;
              }
              if (document.getElementById("link").value==""){
                  alert("联系方式不能为空！");
                  return false;
              }
              if (document.getElementById("trademark").value==""){
                  alert("牌号不能为空！");
                  return false;
              }                          
              if (document.getElementById("quantity").value==""||!/^[1-9]\d*$/.test(document.getElementById("quantity").value)){
                alert("请输入正确的采购数量！");
              	  return false;               
         	  }
              if (document.getElementById("spec").value==""){
                  alert("规格不能为空！");
                  return false;
              }
              if (document.getElementById("orderformid").value==""){
                  alert("订单号码不能为空！");
                  return false;
              }
           }
        }
        </script>
</head>
	<body>

	    <form name="form" method="post" action="stockorderform!insert.do">
		<table class="tableborder" cellspacing=1 cellpadding=4 width="80%" align="center">
			<tr>
			   <td colspan="3" class="header">采购订单编制<input type="hidden" name="act"/></td>
			</tr>
			<colgroup align=left>
				<col class="altbg1" width="20%"/>							
				<col class="altbg2" width="30%"/>
				<col class="altbg1" width="20%"/>
				<col class="altbg2" width="30%"/>
			</colgroup>
			<tr>
				<td width="25%">&nbsp;物品编号 </td>
				<td width="27%"><s:textfield id="goodsid" name="stockorderform.goodsid" maxlength="100" value=""/></td>
				<td width="15%">&nbsp;物品名称</td>
			    <td width="33%"><span><s:textfield id="goodsname" name="stockorderform.goodsname" maxlength="100" value=""/></span></td>
			</tr>
			<tr>
				<td>&nbsp;供应商：</td>
				<td><s:textfield id="provider" name="stockorderform.provider" maxlength="100" value=""/></td>
				<td>&nbsp;联系方式：</td>
				<td><s:textfield id="link" name="stockorderform.link" maxlength="100" value=""/></td>
			</tr>
			<tr>
				<td>&nbsp;牌号：</td>
				<td><span><s:textfield id="trademark" name="stockorderform.trademark" maxlength="100" value=""/></span></td>
				<td>&nbsp;规格：</td>
				<td><span><s:textfield id="spec" name="stockorderform.spec" maxlength="100" value=""/></span></td>
			</tr>
			<tr>
			    <td >&nbsp;提交人：</td>
			    <td><span><%=((Employee)session.getAttribute("employee")).getName()%></span></td>
			    <td> &nbsp;提交日期：</td>
			    <td><span><%= new java.sql.Date(System.currentTimeMillis())%></span></td>
			</tr>
			<tr>
				<td>&nbsp;销售数量：</td>
			    <td><span><s:textfield id="quantity" name="stockorderform.quantity" maxlength="10" value=""/></span></td>
			    <td>&nbsp;订单编号：</td>
			    <td><span><s:textfield id="orderformid" name="stockorderform.orderformid" maxlength="10" value=""/></span></td>
		    </tr>
			<tr>
				<td colspan="4" align="center"><input type="submit" name="savebutton" value="保存" onclick="return check();"/></td>
			</tr>
		</table>
		</form>
	</body>
</html>
